﻿using System;
using System.Collections.Generic;
using System.Web;

namespace WeiSha.Core.Param.Method
{
	// Token: 0x02000036 RID: 54
	public class PageInfo
	{
		// Token: 0x06000228 RID: 552 RVA: 0x0000F6BE File Offset: 0x0000D8BE
		public PageInfo(HttpContext context)
		{
			this._context = context;
		}

		// Token: 0x06000229 RID: 553 RVA: 0x0000F6D6 File Offset: 0x0000D8D6
		public PageInfo()
		{
			this._context = HttpContext.Current;
		}

		// Token: 0x170000D7 RID: 215
		// (get) Token: 0x0600022A RID: 554 RVA: 0x0000F6F4 File Offset: 0x0000D8F4
		public string FileName
		{
			get
			{
				HttpContext httpContext = HttpContext.Current;
				string text = httpContext.Request.CurrentExecutionFilePath;
				bool flag = text.IndexOf("/") > -1;
				if (flag)
				{
					text = text.Substring(text.LastIndexOf("/") + 1);
				}
				return text.ToLower();
			}
		}

		// Token: 0x170000D8 RID: 216
		// (get) Token: 0x0600022B RID: 555 RVA: 0x0000F748 File Offset: 0x0000D948
		public string Name
		{
			get
			{
				string text = this.FileName;
				bool flag = text.IndexOf(".") > -1;
				if (flag)
				{
					text = text.Substring(0, text.LastIndexOf("."));
				}
				return text;
			}
		}

		// Token: 0x170000D9 RID: 217
		// (get) Token: 0x0600022C RID: 556 RVA: 0x0000F78C File Offset: 0x0000D98C
		public string FullNamePhysics
		{
			get
			{
				HttpContext httpContext = HttpContext.Current;
				string absolutePath = httpContext.Request.Url.AbsolutePath;
				return Server.MapPath(absolutePath);
			}
		}

		// Token: 0x170000DA RID: 218
		// (get) Token: 0x0600022D RID: 557 RVA: 0x0000F7BC File Offset: 0x0000D9BC
		public string PurviewLabel
		{
			get
			{
				string name = this.Name;
				string text = name.ToLower();
				bool flag = text.IndexOf("_") > -1;
				if (flag)
				{
					text = text.Substring(0, text.IndexOf("_"));
				}
				return text;
			}
		}

		// Token: 0x170000DB RID: 219
		// (get) Token: 0x0600022E RID: 558 RVA: 0x0000F804 File Offset: 0x0000DA04
		public string ManageFileName
		{
			get
			{
				HttpContext httpContext = HttpContext.Current;
				string text = httpContext.Request.Url.AbsolutePath.ToLower();
				string text2 = "/manage/";
				bool flag = text.IndexOf(text2) > -1;
				if (flag)
				{
					text = text.Substring(text.IndexOf(text2) + text2.Length);
				}
				return text;
			}
		}

		// Token: 0x170000DC RID: 220
		// (get) Token: 0x0600022F RID: 559 RVA: 0x0000F860 File Offset: 0x0000DA60
		public string Extension
		{
			get
			{
				string text = this.FileName;
				bool flag = text.IndexOf(".") > -1;
				if (flag)
				{
					text = text.Substring(text.LastIndexOf(".") + 1);
				}
				return text;
			}
		}

		// Token: 0x170000DD RID: 221
		// (get) Token: 0x06000230 RID: 560 RVA: 0x0000F8A4 File Offset: 0x0000DAA4
		public string Module
		{
			get
			{
				HttpContext httpContext = HttpContext.Current;
				string text = httpContext.Request.ServerVariables["PATH_INFO"].ToLower();
				string text2 = "/manage/";
				string text3 = text.Substring(text.IndexOf(text2) + text2.Length);
				bool flag = text3.IndexOf("/") > -1;
				string text4;
				if (flag)
				{
					text3 = text3.Substring(0, text3.IndexOf("/"));
					text4 = text3;
				}
				else
				{
					text4 = "";
				}
				return text4;
			}
		}

		// Token: 0x170000DE RID: 222
		// (get) Token: 0x06000231 RID: 561 RVA: 0x0000F928 File Offset: 0x0000DB28
		public string AbsolutePath
		{
			get
			{
				HttpContext httpContext = HttpContext.Current;
				string text = httpContext.Request.Url.AbsolutePath;
				bool flag = text.IndexOf("/") > -1;
				if (flag)
				{
					text = text.Substring(0, text.LastIndexOf("/") + 1);
				}
				return text;
			}
		}

		// Token: 0x170000DF RID: 223
		// (get) Token: 0x06000232 RID: 562 RVA: 0x0000F97C File Offset: 0x0000DB7C
		public string PhysicsPath
		{
			get
			{
				return Server.MapPath(this.AbsolutePath);
			}
		}

		// Token: 0x170000E0 RID: 224
		// (get) Token: 0x06000233 RID: 563 RVA: 0x0000F99C File Offset: 0x0000DB9C
		public string Authority
		{
			get
			{
				HttpContext httpContext = HttpContext.Current;
				string text = httpContext.Request.Url.ToString().ToLower();
				bool flag = text.StartsWith("http://");
				if (flag)
				{
					text = "http://" + httpContext.Request.Url.Authority;
				}
				bool flag2 = text.StartsWith("https://");
				if (flag2)
				{
					text = "https://" + httpContext.Request.Url.Authority;
				}
				return text + "/";
			}
		}

		// Token: 0x06000234 RID: 564 RVA: 0x0000FA2C File Offset: 0x0000DC2C
		public string AddPara(string key, string value)
		{
			HttpContext httpContext = HttpContext.Current;
			string text = httpContext.Request.Url.PathAndQuery;
			bool flag = text.IndexOf("?") < 0;
			if (flag)
			{
				text = string.Concat(new string[] { text, "?", key, "=", value });
			}
			else
			{
				text = string.Concat(new string[] { text, "&", key, "=", value });
			}
			return text;
		}

		// Token: 0x06000235 RID: 565 RVA: 0x0000FABC File Offset: 0x0000DCBC
		public string AddPara(string url, params string[] para)
		{
			Dictionary<string, string> dictionary = new Dictionary<string, string>();
			bool flag = url.IndexOf("?") > -1;
			if (flag)
			{
				string text = url.Substring(url.IndexOf("?") + 1);
				foreach (string text2 in text.Split(new char[] { '&' }))
				{
					bool flag2 = text2.IndexOf("=") > -1;
					if (flag2)
					{
						dictionary.Add(text2.Substring(0, text2.IndexOf("=")), text2.Substring(text2.IndexOf("=") + 1));
					}
				}
				url = url.Substring(0, url.IndexOf("?"));
			}
			for (int j = 0; j < para.Length; j++)
			{
				string text3 = "";
				bool flag3 = para[j].IndexOf("=") > -1;
				string text4;
				if (flag3)
				{
					text4 = para[j].Substring(0, para[j].IndexOf("="));
					text3 = para[j].Substring(para[j].IndexOf("=") + 1);
				}
				else
				{
					text4 = para[j];
				}
				bool flag4 = dictionary.ContainsKey(text4);
				if (flag4)
				{
					dictionary[text4] = text3;
				}
				else
				{
					dictionary.Add(text4, text3);
				}
			}
			url += "?";
			foreach (KeyValuePair<string, string> keyValuePair in dictionary)
			{
				url += string.Format("{0}={1}&", keyValuePair.Key, keyValuePair.Value);
			}
			bool flag5 = url.Substring(url.Length - 1) == "&";
			if (flag5)
			{
				url = url.Substring(0, url.Length - 1);
			}
			return url;
		}

		// Token: 0x06000236 RID: 566 RVA: 0x0000FCD0 File Offset: 0x0000DED0
		public string AddPara(params string[] para)
		{
			HttpContext httpContext = HttpContext.Current;
			string pathAndQuery = httpContext.Request.Url.PathAndQuery;
			return this.AddPara(pathAndQuery, para);
		}

		// Token: 0x06000237 RID: 567 RVA: 0x0000FD04 File Offset: 0x0000DF04
		public string RemovePara(string url, params string[] para)
		{
			Dictionary<string, string> dictionary = new Dictionary<string, string>();
			bool flag = url.IndexOf("?") > -1;
			if (flag)
			{
				string text = url.Substring(url.IndexOf("?") + 1);
				foreach (string text2 in text.Split(new char[] { '&' }))
				{
					bool flag2 = text2.IndexOf("=") > -1;
					if (flag2)
					{
						dictionary.Add(text2.Substring(0, text2.IndexOf("=")), text2.Substring(text2.IndexOf("=") + 1));
					}
				}
				url = url.Substring(0, url.IndexOf("?"));
			}
			for (int j = 0; j < para.Length; j++)
			{
				bool flag3 = dictionary.ContainsKey(para[j]);
				if (flag3)
				{
					dictionary.Remove(para[j]);
				}
			}
			url += "?";
			foreach (KeyValuePair<string, string> keyValuePair in dictionary)
			{
				url += string.Format("{0}={1}&", keyValuePair.Key, keyValuePair.Value);
			}
			bool flag4 = url.Substring(url.Length - 1) == "&";
			if (flag4)
			{
				url = url.Substring(0, url.Length - 1);
			}
			return url;
		}

		// Token: 0x06000238 RID: 568 RVA: 0x0000FEA0 File Offset: 0x0000E0A0
		public string RemovePara(params string[] para)
		{
			HttpContext httpContext = HttpContext.Current;
			string pathAndQuery = httpContext.Request.Url.PathAndQuery;
			return this.RemovePara(pathAndQuery, para);
		}

		// Token: 0x040000A3 RID: 163
		private HttpContext _context = null;
	}
}
